#include <iostream>

using namespace std;

void solve()
{
    int l,r;
    cin>>l>>r;
    for(int i=l;i<=r;i++)
    {
        if(i%3==0)
        {
            cout<<"YES"<<endl;
            return ;
        }
    }
    cout<<"NO"<<endl;
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}
